//引入applyMiddleware
import { createStore, applyMiddleware } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'
import rootreducer from '../reducers'
//引入thunk模块
import thunk from 'redux-thunk'
//redux-logger用法
//1.安装redux-logger
//引入applyMiddleware 和 logger
//在createStore(applyMiddleware(logger))
//中间件的次序是有讲究的,有文档规定,一般logger都是在最后
// !redux-thunk的作用,用来处理dispatch传递函数的情况,用来处理异步更新
export default createStore(rootreducer, composeWithDevTools(applyMiddleware(thunk)))